home *** CD-ROM | disk | FTP | other *** search
- -- Auto-rotate
- --Rotates a QT3 Sprite by a fixed number of degrees per frame.
- --
- --PARAMETERS:
- --
- --Initial Rotation - Specify the starting rotation for the sprite
- --Rotate Degrees - Specify the number of degrees to rotate each frame
- -- (+: clockwise, -: counter-clockwise)
-
- property rotateDelta
- property initialRotation
- property bFirstFrame
-
- on beginSprite me
- set bFirstFrame = true
- end
-
- on prepareFrame me
- if bFirstFrame then
- set the rotation of sprite the spritenum of me to initialrotation
- set bFirstFrame = false
- end if
-
- set newrotation = the rotation of sprite the spritenum of me + rotateDelta
- if newrotation > 360 then
- set newrotation = newrotation - 360
- end if
- if newrotation < 0 then
- set newrotation = newrotation + 360
- end if
-
- set tempRotation = the rotation of sprite the spritenum of me
-
- if tempRotation <> newrotation then
- set the rotation of sprite the spritenum of me to newrotation
- end if
- end
-
- on exitFrame me
- end
-
-
- ---
-
- on getPropertyDescriptionList
-
- set p_list = [ ¬
- #initialRotation: [ #comment: "Initial rotation:", ¬
- #format: #float, ¬
- #default: 0.0 ], ¬
- #rotateDelta: [ #comment: "Rotate degrees per frame:", ¬
- #format: #float, ¬
- #default: 10.0 ] ¬
- ]
- return p_list
-
- end
-
- on getBehaviorDescription
- return ¬
- "Rotates a QT3 Sprite by a fixed number of degrees per frame." && RETURN & RETURN &¬
- "PARAMETERS:" && RETURN & ¬
- "Initial Rotation - Specify the starting rotation for the sprite" && RETURN & ¬
- "Rotate Degrees - Specify the number of degrees to rotate each frame (+: clockwise, -: counter-clockwise"
-
- end
-
-